<layout name="layout"/>
<include file="./nav"/>

<!-- BEGIN CONTAINER -->

<div class="page-container row-fluid">

    <!-- BEGIN PAGE -->

    <div class="page-content">

        <!-- BEGIN PAGE CONTAINER-->

        <div class="container-fluid">

            <!-- BEGIN PAGE HEADER-->

            <div class="row-fluid">

                <div class="span12">

                    <!-- BEGIN PAGE TITLE & BREADCRUMB-->

                    <h3 class="page-title">{$_page_title}</h3>

                    <ul class="breadcrumb">

                        <li>

                            <i class="icon-home"></i>

                            <a href="{:U('Index/index')}">首页</a>

                            <i class="icon-angle-right"></i>

                        </li>

                        <li>

                            <a href="#">{$_module_name}</a>

                            <i class="icon-angle-right"></i>

                        </li>

                        <li><a href="#">{$_page_title}</a></li>

                    </ul>

                    <!-- END PAGE TITLE & BREADCRUMB-->

                </div>

            </div>

            <!-- END PAGE HEADER-->

            <!-- BEGIN PAGE CONTENT-->

            <div class="row-fluid">

                <div class="span12">

                    <!-- BEGIN EXAMPLE TABLE PORTLET-->

                    <div >

                        <div class="portlet-title">

                            <div class="caption"><i class="icon-edit"></i>订单信息</div>


                        </div>

                        <form method="post" action="" name="listForm" onsubmit="">
                            <input type="hidden" name="id" value="{$order.id}">
                            <div  >
                                <table cellpadding="3" cellspacing="1" class="table table-striped table-hover table-bordered dataTable">
                                    <thead style="background: #C5C1AA">
                                    <tr role="row">
                                        <th >订单号</th>
                                        <th >商品名称</th>
                                        <th >商品图片</th>
                                        <th >商品规格</th>
                                        <th >商品数量</th>
                                        <th >商品单价</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <?php foreach($order['goods_list'] as $k => $v): ?>
                                    <tr class="tron">
                                        <td><?php echo $order['order_sn'];?></td>
                                        <td><?php echo $v['goods_name']; ?></td>
                                        <td><?php showImage($v['sm_logo'],'goods/','logo/'); ?></td>
                                        <td>
                                            <?php foreach($v['gaData'] as $k1 => $v1): ?>
                                            <p><?php echo $v1['attr_name'];?>:<?php echo $v1['attr_value'];?></p>
                                            <?php endforeach; ?>
                                        </td>
                                        <td><?php echo $v['goods_number']; ?></td>
                                        <td><?php echo $v['price']; ?></td>
                                    </tr>
                                    <?php endforeach; ?>
                                    </tbody>
                                </table>
                                <br/>

                                <table cellpadding="3" cellspacing="1" class="table table-striped table-hover table-bordered dataTable">
                                    <thead style="background: #C5C1AA">
                                        <tr role="row">
                                            <th>收货人</th>
                                            <th>收货电话</th>
                                            <th>收货地址</th>
                                            <th>快递单号</th>
                                            <th>订单总价</th>
                                            <th>下单时间</th>
                                            <th>状态</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <tr class="tron">
                                            <td><?php echo $order['shr_name'];?></td>
                                            <td><?php echo $order['shr_tel'];?></td>
                                            <td>
                                                <?php echo $order['shr_province'];?>
                                                <?php echo $order['shr_city'];?>
                                                <?php echo $order['shr_area'];?>
                                                <?php echo $order['shr_address'];?>
                                            </td>
                                            <td><?php echo $order['post_number'];?></td>
                                            <td><span style="font-size:20px;color:red;"><?php echo $order['total_price'];?></span></td>
                                            <td><?php echo date('Y-m-d H:i:s',$order['addtime']);?></td>
                                            <td>
                                                <?php if($order['status'] == '是'):?>
                                                    <?php if($order['pay_status'] == '是'):?>
                                                        <?php echo $order['post_status'] == 1 ? '已发货' : ($order['post_status'] == 2 ? '已签收' : '未发货');?>
                                                    <?php else: ?>
                                                        <?php echo makeAliPayBtn($order['id']); ?>
                                                    <?php endif;?>
                                                <?php else:?>
                                                    已取消
                                                <?php endif;?>
                                            </td>
                                        </tr>
                                    </tbody>
                                </table>
                                <form name="main_form" method="post" action="__SELF__" enctype="multipart/form-data">
                                    <input type="hidden" name="id" value="{$order.id}">
                                    <table cellpadding="3" cellspacing="1" class="table table-striped table-hover table-bordered dataTable">
                                        <tr>
                                            <td> 订单状态：</td>
                                            <td>
                                                <select <?php if($order['order_status'] == 2):?> disabled<?php endif;?>name="order_status" class="form-control">
                                                    <option <?php if($order['order_status']=='正常'):?>selected<?php endif;?> value="正常">正常</option>
                                                    <option <?php if($order['order_status']=='关闭'):?>selected<?php endif;?> value="关闭">关闭</option>
                                                </select>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>支付状态：</td>
                                            <td><input disabled value="<?php echo $order['pay_status']=='是' ? '已支付' : '未支付';?>" class="form-control"></td>
                                        </tr>
                                        <tr>
                                            <td>发货状态：</td>
                                            <td>
                                                <select <?php if($order['post_status']==2):?>disabled<?php endif;?>name="post_status" class="form-control">
                                                    <option <?php if($order['post_status']==0):?>selected<?php endif;?> value="0">未发货</option>
                                                    <option <?php if($order['post_status']==1):?>selected<?php endif;?> value="1">已发货</option>
                                                    <option <?php if($order['post_status']==2):?>selected<?php endif;?> value="2">已签收</option>
                                                </select>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>快递单号：</td>
                                            <td>
                                                <input type="text" class="form-control" placeholder="请输入快递单号!" name="post_number"
                                                <?php if($order['post_status']==2):?>disabled<?php endif;?> value="<?php echo $order['post_number'];?>"
                                                  >
                                            </td>
                                        </tr>
                                        <?php if($order['post_status']==2):?>
                                        <tr>
                                            <td colspan="99" align="center">
                                                <span style="font-size:30px;color:skyblue">该订单已交易完成！</span>
                                            </td>
                                        </tr>
                                        <?php endif; ?>
                                        <tr>
                                            <td><input type="submit" class="btn" value="确定"></td>
                                        </tr>
                                    </table>
                                </form>
                            </div>
                            <!--<div class="span6">
                                <div class="dataTables_paginate paging_bootstrap pagination">
                                    <ul>
                                        <li>{$page}</li>
                                    </ul>
                                </div>
                            </div>-->
                        </form>

                    </div>

                    <!-- END EXAMPLE TABLE PORTLET-->

                </div>

            </div>

            <!-- END PAGE CONTENT -->

        </div>

        <!-- END PAGE CONTAINER-->

    </div>

    <!-- END PAGE -->

</div>

<!-- END CONTAINER -->

<!-- BEGIN JAVASCRIPTS(Load javascripts at bottom, this will reduce page load time) -->

<!-- BEGIN CORE PLUGINS -->

<script src="__PUBLIC__/media/js/jquery-1.10.1.min.js" type="text/javascript"></script>

<script src="__PUBLIC__/media/js/jquery-migrate-1.2.1.min.js" type="text/javascript"></script>

<!-- IMPORTANT! Load jquery-ui-1.10.1.custom.min.js before bootstrap.min.js to fix bootstrap tooltip conflict with jquery ui tooltip -->

<script src="__PUBLIC__/media/js/jquery-ui-1.10.1.custom.min.js" type="text/javascript"></script>

<script src="__PUBLIC__/media/js/bootstrap.min.js" type="text/javascript"></script>

<!--[if lt IE 9]>

<script src="__PUBLIC__/media/js/excanvas.min.js"></script>

<script src="__PUBLIC__/media/js/respond.min.js"></script>

<![endif]-->

<script src="__PUBLIC__/media/js/jquery.slimscroll.min.js" type="text/javascript"></script>

<script src="__PUBLIC__/media/js/jquery.blockui.min.js" type="text/javascript"></script>

<script src="__PUBLIC__/media/js/jquery.cookie.min.js" type="text/javascript"></script>

<script src="__PUBLIC__/media/js/jquery.uniform.min.js" type="text/javascript" ></script>

<!-- END CORE PLUGINS -->

<!-- BEGIN PAGE LEVEL PLUGINS -->

<script type="text/javascript" src="__PUBLIC__/media/js/select2.min.js"></script>

<script type="text/javascript" src="__PUBLIC__/media/js/jquery.dataTables.js"></script>

<script type="text/javascript" src="__PUBLIC__/media/js/DT_bootstrap.js"></script>

<!-- END PAGE LEVEL PLUGINS -->

<!-- BEGIN PAGE LEVEL SCRIPTS -->

<script src="__PUBLIC__/media/js/app.js"></script>

<script src="__PUBLIC__/media/js/table-editable.js"></script>

<script>

    jQuery(document).ready(function() {

        App.init();

        TableEditable.init();

    });

</script>

</body>

<!-- END BODY -->

</html>

<!--时间插件-->
<link href="__PUBLIC__/datetimepicker/jquery-ui-1.9.2.custom.min.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" charset="utf-8" src="__PUBLIC__/datetimepicker/jquery-ui-1.9.2.custom.min.js"></script>
<script type="text/javascript" charset="utf-8" src="__PUBLIC__/datetimepicker/datepicker-zh_cn.js"></script>
<link rel="stylesheet" media="all" type="text/css" href="__PUBLIC__/datetimepicker/time/jquery-ui-timepicker-addon.min.css" />
<script type="text/javascript" src="__PUBLIC__/datetimepicker/time/jquery-ui-timepicker-addon.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/datetimepicker/time/i18n/jquery-ui-timepicker-addon-i18n.min.js"></script>
<script>
    // 添加时间插件
    $.timepicker.setDefaults($.timepicker.regional['zh-CN']);  // 设置使用中文

    $("#fa").datetimepicker();
    $("#ta").datetimepicker();
</script>

<!-- 引入行高亮显示 -->
<script type="text/javascript" src="__PUBLIC__/Admin/Js/tron.js"></script>
